package com.jing.cloud.util;

import java.util.HashMap;
import java.util.Iterator;
import java.util.ResourceBundle;

public class PropertiesUtil {
    private static HashMap<String,String> configMap=new HashMap<String,String>();

    private static void initPropertiesUtil(){

        ResourceBundle resourceBundle=ResourceBundle.getBundle("config");
        Iterator<String> ite= resourceBundle.keySet().iterator();
        while (ite.hasNext()){
            String key=ite.next();
            configMap.put(key,resourceBundle.getString(key));
        }

    }
    public static String getProperties(String key){
        if(configMap.size()==0){
            initPropertiesUtil();
        }
        return configMap.get(key);
    }

}
